package com.leyou.item.mapper;

import com.leyou.item.domain.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface BrandMapper extends Mapper<Brand> {
    public void insertBrandAndCategory(@Param("cids") List<Long> cids, @Param("bid") Long brandId);

    @Select("SELECT b.* FROM tb_brand b, tb_category_brand cb " +
            "WHERE b.id = cb.brand_id AND cb.category_id=#{id}")
    public List<Brand> findBrandsByCid(Long id);
}
